#include <sys/types.h>
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
int main()
{
    int fp=open("./c.txt",O_WRONLY|O_CREAT|O_APPEND,0777);
    if(fp==-1)
        perror("open");
    for(int i=0;i<10;i++)
    {
        write(fp,"hello",5);
        write(fp,"world",5);
        write(fp,"\n",1);
        sleep(1);
    }
    close(fp);
    return 0;
}